import type { Rule } from 'ant-design-vue/lib/form'

export const formRule: Record<string, Rule[]> = {
  username: [
    {
      required: true,
      message: '请输入用户名',
      trigger: 'blur'
    }
  ],
  deptId: [
    {
      required: true,
      message: '请选择部门',
      trigger: 'blur'
    }
  ],
  phone: [
    {
      required: true,
      message: '请输入手机号码',
      trigger: 'blur'
    },
    {
      pattern: /^(1[3456789]\d{9}|0\d{2,3}-\d{7,8})$/,
      message: '手机号码格式不正确',
      trigger: 'blur'
    }
  ],
  postIds: [
    {
      required: true,
      message: '请选择岗位',
      trigger: 'blur'
    }
  ]
}
